home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
shadez.swf
/
scripts
/
Local
/
Draw
/
CCE.as
< prev
next >
Wrap
Text File
|
2011-08-19
|
6KB
|
206 lines
package Local.Draw
{
import flash.display.BitmapData;
import flash.display.Graphics;
import flash.display.MovieClip;
import flash.filters.BlurFilter;
import flash.filters.GlowFilter;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.geom.Rectangle;
public class CCE extends MovieClip
{
public static const zPoint:Point;
{
if(true)
{
zPoint = new Point(0,0);
}
}
private var mSize:Number;
private var mEase:Number;
private var mFrames:Array;
private var mEaseDecay:Number;
private var mCount:int;
private var mFilters:Array;
private var mParticles:Object;
public function CCE(param1:Number = 1)
{
super();
mParticles = new Object();
mFrames = new Array();
mCount = 15;
mEase = 7;
mEaseDecay = 0.8;
mSize = param1;
mFilters = [new BlurFilter(2,2,3),new GlowFilter(16777215,1,16 * mSize,16 * mSize,5,3)];
}
public function RenderFrames() : Array
{
var _loc1_:* = uint(0);
var _loc2_:Object = null;
var _loc3_:int = 0;
var _loc4_:int = 0;
loop0:
while(true)
{
this.graphics.clear();
if(true)
{
_loc4_ = mEase;
if(true)
{
while(true)
{
if(!_loc4_)
{
mEase = Math.max(1,mEase * mEaseDecay);
addr65:
if(_loc3_ == 0)
{
break;
}
mFrames.push(RenderAsBMD());
}
else
{
_loc3_ = Process();
if(true)
{
continue;
}
}
continue loop0;
}
_loc1_ = uint(0);
}
for each(_loc2_ in mFrames)
{
if(true)
{
§§push(_loc1_);
if(true)
{
§§push(uint(§§pop() + _loc2_.bmd.width * _loc2_.bmd.height * 4));
}
_loc1_ = §§pop();
}
}
break;
}
break;
}
return mFrames;
}
public function AddParticles() : void
{
var _loc1_:Number = NaN;
var _loc2_:* = NaN;
var _loc3_:Point = null;
var _loc4_:CCE_Particle = null;
if(true)
{
_loc1_ = Math.random() * 360;
_loc2_ = Number(30);
}
while(_loc2_)
{
_loc3_ = Point.polar(Math.random() * 10 * mSize,Math.random() * Math.PI * 2);
_loc4_ = new CCE_Particle(new Point(0,0),_loc3_);
mParticles[_loc4_.mID] = _loc4_;
§§push(_loc2_);
if(true)
{
§§push(Number(§§pop() - 1));
}
_loc2_ = §§pop();
}
}
private function Process() : int
{
var _loc1_:int = 0;
var _loc2_:CCE_Particle = null;
var _loc3_:*;
§§push((_loc3_ = §§findproperty(mCount)).mCount);
if(true)
{
var _loc4_:*;
§§push(_loc4_ = §§pop() - 1);
if(true)
{
_loc3_.mCount = _loc4_;
}
}
if(§§pop() > 0)
{
AddParticles();
}
_loc1_ = 0;
for each(_loc2_ in mParticles)
{
§§push(_loc2_.Process());
if(true)
{
if(§§pop())
{
_loc1_++;
continue;
}
§§push(delete mParticles[_loc2_.mID]);
}
§§pop();
}
return _loc1_;
}
private function Render() : void
{
var _loc1_:Graphics = null;
var _loc2_:CCE_Particle = null;
_loc1_ = this.graphics;
for each(_loc2_ in mParticles)
{
_loc2_.Render(_loc1_);
}
}
private function RenderAsBMD() : Object
{
var _loc1_:Rectangle = null;
var _loc2_:BitmapData = null;
var _loc3_:Point = null;
var _loc4_:* = undefined;
_loc1_ = this.getBounds(this);
_loc1_.inflate(16 * mSize,16 * mSize);
_loc2_ = new BitmapData(_loc1_.width,_loc1_.height,true,16711680);
_loc3_ = new Point(Math.floor(_loc1_.left),Math.floor(_loc1_.top));
if(true)
{
_loc2_.draw(this,new Matrix(1,0,0,1,-_loc3_.x,-_loc3_.y));
}
for each(_loc4_ in mFilters)
{
_loc2_.applyFilter(_loc2_,_loc2_.rect,zPoint,_loc4_);
}
return {
"bmd":_loc2_,
"disp":_loc3_
};
}
}
}